<?php

namespace app\common\model;

class ShopOrder extends BaseModel
{
    public function good(){
        return $this->hasMany('ShopOrderGoods','order_id');
    }
    public function getAddressInfoAttr($val){
        return json_decode($val,true);
    }
    public function goodsRecord(){
        return $this->hasMany('ShopOrderGoods','order_id');
    }
    public function express(){
        return $this->hasOne('ShopOrderExpress','order_id');
    }

    public function user(){
        return $this->hasOne('User','id','uid');
    }
}
